<%@ page import="com.example.bean.Person" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.HashMap" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

    <%
        Person person = new Person();
        person.setName("国哥");
        person.setPhones(new String[]{"1862392932","18295282822","135298328382"});
        ArrayList<String> cities = new ArrayList<>();

        cities.add("北京");
        cities.add("上海");
        cities.add("深圳");
        person.setCities(cities);

        HashMap<String, Object> map = new HashMap<>();
        map.put("key1","value1");
        map.put("key2","value2");
        map.put("key3","value3");

        person.setMap(map);

        pageContext.setAttribute("p",person);
    %>


    输出Person: ${p} <br>
    输出Person的name属性：${p.name} <br>
    输出Person的phones数组属性值：${p.phones[0]} <br>
    输出Person的cities集合中的元素值：${p.cities} <br>
    输出Person的cities集合中的个别元素值：${p.cities.get(0)} <br>
    输出Person的map集合中的元素值：${p.map} <br>
    输出Person的map集合中的个别元素值：${p.map.get("key2")} <br>

    输出Person的age属性：${p.age} <br>




</body>
</html>
